from frontend.roleApplication import RoleApplication
from frontend.form import Type
from vars import *



class DeliveryApplication(RoleApplication):

    def __init__(self):
        super(DeliveryApplication, self).__init__(WorkflowName, Role.TruckDriver)
        # Here we use SINK step.  This lets the user choose a pre-existing record to work with from a queue on the left side
        self.register_sink_step(Step.Delivery, self.generic_middle_or_ending_role_form_creator, name_fields=['AddressName','PillowType','PillowQuantity'])
        
    def generic_middle_or_ending_role_form_creator(self, stepname, form):
        form.add_static_label('Delivery Confirmation')
        form.add_task_label(fields=['Packaged', 'Shipped']) 
        form.add_field(Type.BOOLEAN, 'Delivered',labeltext="Delivered", initial=False)

if __name__ == '__main__':
    app = DeliveryApplication()
    app.MainLoop()